package com.team11.server.service.admin;

import com.team11.server.mapper.Admin_UpdateKc_Mapper;
import com.team11.server.pojo.SelKcInformation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class Admin_UpdateKc_Service {
    @Autowired
    private Admin_UpdateKc_Mapper admin_updateKc_mapper;
    //编辑课程返回原始信息
    public List<SelKcInformation> updateKc(Integer sKid){
        return admin_updateKc_mapper.SelKcBySid(sKid);
    }
    //更新前清空
    public void DeleteSxT(Integer skId){
        admin_updateKc_mapper.DeleteSx(skId);
    }
    //更新上课表信息
    public void UpdateSk(HashMap<String,Object> map){
        admin_updateKc_mapper.UpdateSk(map);
    }
    //更新课程表信息和责任老师
    public void UpdateKcZrT(HashMap<String,Object> map){
        String tN= (String) map.get("zRtName");
        String[] tArray=tN.split("-");
        String tNumber=tArray[0];
        map.put("tJobNumber",tNumber);
        admin_updateKc_mapper.UpdateKc(map);
    }
    //更新实训老师
    public void InsertSxT(HashMap<String,Object> map){
        String tN= (String) map.get("sxTeacher");
        String[] tArray=tN.split("-");
        String tNumber=tArray[0];
        map.put("tJobNumber",tNumber);
        admin_updateKc_mapper.InsertSxT(map);
    }

}
